/*
 * test_map.cpp
 *
 *  Created on: Jan 5, 2014
 *      Author: killerg
 */

#include <map>
#include <unordered_map>

template <typename K, typename V, typename MapT = std::map<K, V> >
class map_ptr : public MapT {
public:
	V get(K k) {
		auto itr = this->find(k);
		if (itr == this->end())
			return K(NULL);
		return itr->second;
	}
	void set(K k, V v) {
		this->insert(std::make_pair(k, v));
	}
};

bool test_map() {
	map_ptr<int, int*> m1;
	map_ptr<int, int*, std::unordered_map<int, int*> > m;
	int a;
	m1.set(1, &a);
	int* b = m1.get(1);

	return true;
}
